<template>
<div class="audit-panel-group">
    <div class="panel">
        <div class="panel-header bd">
            <div class="bl"></div>
            <div class="title">收款信息</div>
        </div>
        <div class="panel-body">
            <div class="list-group">
                <div class="list-item">
                    <div class="row">
                        <div class="title">收款人</div>
                        <div class="value">{{ income.user.realname}}</div>
                    </div>
                </div>

                <div class="list-item">
                    <div class="row">
                        <div class="title">收款性质</div>
                        <div class="value">{{ income.type.title}}</div>
                    </div>
                </div>

                <div class="list-item">
                    <div class="row">
                        <div class="title">收款方式</div>
                        <div class="value">{{income.way.title }}</div>
                    </div>
                </div>

                <div class="list-item">
                    <div class="row">
                        <div class="title">收款时间</div>
                        <div class="value">{{ income.create_time}}</div>
                    </div>
                </div>

                <div class="list-item">
                    <div class="row">
                        <div class="title">收款金额</div>
                        <div class="value">{{income.total}}</div>
                    </div>
                </div>

                <div class="list-item">
                    <div class="row">
                        <div class="title">备注</div>
                    </div>
                    <div class="intro">
                        {{income.remark}}
                    </div>
                </div>
            </div>

            <div class="list-item">
                <div class="row">
                    <div class="title">凭证</div>
                    <div class="value"></div>
                </div>
                <div class="intro">
                    <div v-if="income.receipt.length > 0" class="order-files">
                        <upload-file-list :file-list="income.receipt"></upload-file-list>
                    </div>
                </div>
            </div>

            <div class="list-item">
                <div class="row">
                    <div class="title">收据</div>
                    <div class="value"></div>
                </div>
                <div class="intro">
                    <div v-if="income.note.length > 0" class="order-files">
                        <upload-file-list :file-list="income.note"></upload-file-list>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</template>

<script>
import uploadFileList from '@/components/files/index';

export default {
    name: "AuditIncome",
    components: {
        uploadFileList
    },
    props: {
        income: {
            type: Object,
            default: function () {
                return {
                    user: {
                        id: '',
                        realname: ''
                    },
                    type: {
                        id: '',
                        title: ''
                    },
                    way: {
                        id: '',
                        title: ''
                    },
                    receipt: [],
                    note: []
                }
            }
        }
    },
    data() {
        return {

        };
    },
    computed: {
        receipt: function () {
            let imgs = [];
            if (this.income.receipt) {
                this.income.receipt.forEach(e => {
                    imgs.push(e.url)
                });

            }
            return imgs;
        },
        note: function () {
            let imgs = [];
            if (this.income.note) {
                this.income.note.forEach(e => {
                    imgs.push(e.url)
                });

            }
            return imgs;
        }
    },
    methods: {

    }
}
</script>
